package com.lhn.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author lhn
 * @date 2024-08-21 13:48
 */
@Component  // 将当前类标识为bean
@Aspect // 将当前类标识为切面类
public class MyAdvice {

    @Pointcut("execution(void com.lhn.dao.BookDao.update())")
    public void beforeMethod() {}

    @Before("beforeMethod()")
    public void adviceMethod() {
        System.out.println(System.currentTimeMillis());
    }
}
